<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('项目管理')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>

<div th:replace="public/top::top"></div>

<div id="Xiangmulist">

    <div th:replace="main/edit_xiangmu::editXiamgu"></div>
    <div th:replace="main/Upload"></div>
    <!--<div th:replace="manage/edit_chouquren" ></div>
   <div th:replace="manage/edit_jianduren" ></div>-->
    <div class="primary-title">
        项目管理
        <span class="btn btn-success" style="float:right;margin-right:15px;margin-top:10px;"
              v-on:click="toAdd()">新 增</span>
    </div>

    <div class="primary-content">

        <div style="margin-top:15px;text-align: center;">
            <label  style="margin-left: 20px;">项目名称：</label><input type="text" class="form-control" style="width: 150px;display:inline-block;"  v-model="xiangmutext"  >
            <button class="btn btn-info" @click="bindXiangmuList()" style="margin-left:15px;">查询</button>
        </div>


        <div class="table-responsive" style="overflow:inherit;margin-top:40px;">

            <table class="table table-hover table-striped">
                <thead>
                <th style="text-align:center;vertical-align:middle;width: 50px;">序号</th>
                <th style="text-align:center;vertical-align:middle;">项目名称</th>
                <th style="text-align:center;vertical-align:middle;">项目类型</th>
                <th style="text-align:center;vertical-align:middle;width:80px;">导入</th>
                <th style="text-align:center;vertical-align:middle;width:80px;">查看</th>
                <th style="text-align:center;vertical-align:middle;width:80px;">打印</th>
                <th style="text-align:center;vertical-align:middle;width:200px;">是否当前活动项目</th>
                <th style="text-align:center;vertical-align:middle;width:80px;">进度</th>
                <th style="text-align:center;vertical-align:middle;width:160px;">操作</th>
                </thead>

                <tbody>
              <tr v-for="(xiangmuitem,index) in xiangmulist" v-if="show">
                    <td style="text-align:center;vertical-align:middle;" v-text="index+1+(pageIndex-1)*pageSize"></td>
                    <td style="text-align:center;vertical-align:middle;" v-text="xiangmuitem.xiangmuname"></td>
                    <td style="text-align:center;vertical-align:middle;" v-text="xiangmuitem.text"></td>

                    <td style="text-align:center;vertical-align:middle;" v-text="">
                        <button v-on:click="toshowUploadXls(xiangmuitem.xiangmuid,xiangmuitem.xiangmuleixing)" class="btn btn-info">导入</button>
                    </td>

                    <td style="text-align:center;vertical-align:middle;" v-text="">
                        <button v-on:click="toShowXiangmuDetailList(xiangmuitem.xiangmuid,xiangmuitem.xiangmuleixing)" class="btn btn-info">查看</button>
                    </td>

                  <td style="text-align:center;vertical-align:middle;" v-text="">
                      <button v-on:click="toPrintlList(xiangmuitem.xiangmuid,xiangmuitem.xiangmuleixing)" class="btn btn-info">下载</button>
                  </td>

                    <td style="text-align:center;vertical-align:middle;" v-if="xiangmuitem.isactived==1" v-text="">是</td>
                    <td style="text-align:center;vertical-align:middle;" v-else v-text="">
                        <button v-on:click="toModifyIsactived(xiangmuitem.xiangmuid)" class="btn btn-default">设置为活动项目</button>
                    </td>
                  <td style="text-align:center;vertical-align:middle;" v-text="">
                      <button v-on:click="toShowJindu(xiangmuitem.xiangmuid,xiangmuitem.xiangmuleixing)" class="btn btn-success">查看进度</button>
                  </td>

                    <td style="text-align:center;vertical-align:middle;">
                        <button v-on:click="toModify(xiangmuitem.xiangmuid)" class="btn btn-primary">修 改</button>
                        <button class="btn btn-danger" v-on:click="toDelete(xiangmuitem.xiangmuid)">删 除</button>
                    </td>
                </tr>

                </tbody>

            </table>
            <div v-if="!show" style="text-align:center;width:100%;">查无数据</div>

            <div v-if="show" class="my-page-navigation">
                <button class="btn btn-default" v-on:click="SetPageIndex">首页</button>
                <button class="btn btn-default" v-on:click="SetPageIndexPrePage">上一页</button>
                <span v-text="pageIndex + '  /  ' + pageCount"></span>
                <span v-text="'共' + recordCount + '条'"></span>
                <button class="btn btn-default" v-on:click="SetPageIndexNextPage">下一页</button>
                <button class="btn btn-default" v-on:click="SetPageEnd">尾页</button>
                <span>跳到第</span>
                <input type="text" class="form-control" style="width: 80px;display:inline-block;"  v-model="inputPageIndexValue" v-on:keyup.enter="JumpPage">
                <span>页</span>
                <button class="btn btn-default" v-on:click="JumpPage">跳</button>
            </div>
        </div>

    </div>

</div>
</body>

<script th:src="@{/js/main/list_xiangmu.js}"></script>

<script type="text/javascript">
    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });
</script>
</html>